package com.ldk.framework.dao.impl;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.session.SqlSession;
import org.springframework.stereotype.Repository;
import org.springframework.util.Assert;

import com.ldk.base.framework.dao.impl.BaseDAO;
import com.ldk.base.framework.util.BeanUtil;
import com.ldk.framework.dao.IServiceTripCrewsDAO;
import com.ldk.framework.entity.ServiceTripCrews;

/**
* ServiceTripCrewsDAO接口实现类
* @author xiangwl
*/
@Repository
public class ServiceTripCrewsDAO extends BaseDAO<ServiceTripCrews> implements IServiceTripCrewsDAO {

	@Override
	public int updateIn(String dbKey, ServiceTripCrews entity,List<String> crewTripNoLst) {
		Assert.notNull(entity);
		Assert.notNull(crewTripNoLst);
		try{
			Map<String, Object> parms = BeanUtil.toMap(entity);
			parms.put("inList", crewTripNoLst);
			SqlSession sqlSession = getSqlSession(dbKey);
		    return sqlSession.update(getSqlName("updateIn"), parms);
		    
		}catch(Exception e){
			logger.error(e.getMessage());
		}
		return 0;
	}

}
